package thread;

public class DaemonThreadDemo {
    public static void main(String[] args) {
        Thread rose = new Thread(){
            public void run(){
                for (int i =0;i<5;i++){
                    System.out.println("跳，跳，快跳");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }

            }
        };
        Thread jack = new Thread(){
          public void run(){
              while (true){
                  System.out.println("快跳，我们一起");
                  try {
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      throw new RuntimeException(e);
                  }
              }

          }
        };
        rose.start();
        jack.setDaemon(true);
        jack.start();
    }
}
